package top.kaoshanji.p2ch06a.support;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 继承 ThreadPoolExecutor
 * author kaoshanji
 * ^_^
 * create time 2025/1/17 16:32
 */
public class DebugExecutorService extends ThreadPoolExecutor {

    public DebugExecutorService(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
    }

    @Override
    protected void beforeExecute(Thread t, Runnable r) {
        System.out.println("清理任务：" + r.getClass());
        super.beforeExecute(t, r);
    }
}
